<!DOCTYPE html>
<html>
<head>
	<title>jquery form</title>
	<script type="text/javascript" src="jquery-3.2.1.js"></script>
</head>
<body>
	<div id="signIn">
		<form name="logIn">
			<label for="name">姓名</label><input  id="name" name="username" type="text" placeholder="请输入密码"><br>
			<label for="password">密码</label><input id="password" name="password" type="password" placeholder="******"><br>
		</form>
		<button type="button" id="btm_submit">提交</button>
	</div>

	<script type="text/javascript">
		var username=document.getElementById("name").value;
		var pwd=document.getElementById("password").innerHTML;
		var submit_url="http://ecidi.igevin.info/posts/user-api/accounts/api/user/login2";
		
		$("#btm_submit").click(function(){$.ajax({
			url:submit_url,
			type:"post",
			datatype:"json",
			data:{"username":username,
			"password": pwd},
			success:function(data)
			{
				if (data==true)
				{
					alert("登陆成功");
				}
				else
				{
					alert("登录失败");
				}
			}

		})
			}
			
			)
	</script>
</body>
</html>